
import { request } from '@umijs/max';
import qs from 'qs';


export async function list(body: Record<string, any>, options?: { [key: string]: any }) {
  return request('http://localhost:8887/api/redPackage/list', {
    method: 'POST',
    data: qs.stringify({
      ...body,
      pageNumber: body.current ||1,
    }),
    ...(options || {}),
  }).then(response => ({
    success: true,
    data: response.data.content,
    total: response.data.total,
  }));
}
